$(function () {
    var url ="/logisticsStaff/queryAll" ;
    var data ='';
    var arr = '';
    var arrs = [];
    $.post(url,data,function (resp) {

        console.log(resp.data)
        console.log(resp.name)
        $('.right .layui-nav-item:first-child').html(resp.name);
        //  resp.data.shift();
        //$('#side-nav #nav').empty();
        $('.left-nav #side-nav #nav li').remove();
        $.each(resp.data, function (index, item) {
            console.log('进来了循环')

            let li_ =
                "<li>\n" +
                "                        <a href=\"javascript:;\" >\n" +
                "                            <i class=\"iconfont left-nav-li\" lay-tips='"+item.modelName+"'> </i>\n" +
                "                            <cite>"+item.modelName+"</cite>\n" +
                "                            <i class=\"iconfont nav_right\"></i></a>\n" +
                "                        <ul class=\"sub-menu\">\n" ;
            $.each(item.logisticsModelVos,function(index1,item1){
                li_+=
                    "                            <li>\n" +
                    "                                <a onclick=\"xadmin.add_tab('"+item1.modelName+"','"+item1.modelUrl+"')\" >\n" +
                    "                                    <i class=\"iconfont\"></i>\n" +
                    "                                    <cite>"+item1.modelName+"</cite></a>\n" +
                    "                            </li>\n"  ;
                console.log(item1.modelUrl)
            });


            li_+= "                        </ul>\n" ;

            li_+=   "                    </li>";
            console.log(li_)
            console.log(typeof  li_)
            $('#side-nav #nav').append(li_);

        });
    });

});

function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}
